#ifndef NETPROTOCOL_H
#define NETPROTOCOL_H

#include <QObject>

class NetProtocol : public QObject
{
    Q_OBJECT
public:
    explicit NetProtocol(QObject *parent = nullptr);
static NetProtocol *getObject();
bool deviceLogin(QString id,QString key);
bool uploadSensorData(int boardId,
        double tem, double hum1,double hum2,
        int light,double press,bool water1,bool water2
        );
void handleFrame(const QByteArray &temp);
void  LoginFeedBack(const QJsonObject &obj);//登录信息反馈
void   controlNormalDevice(const QJsonObject &obj);
protected:
static NetProtocol * obj;
QString secretKey;
signals:
void showMessage(const QString &message);
public slots:
 void NetReadSlot( QByteArray data);
};

#endif // NETPROTOCOL_H
